package ru.urfc.portal.model.radio;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

import ru.urfc.portal.model.catalogs.DeviceRealization;
import ru.urfc.portal.model.catalogs.DeviceState;
import ru.urfc.portal.model.catalogs.DeviceType;
import ru.urfc.portal.ui.client.Constants;

@Table(name = "portal_devices")
@Entity
@XmlRootElement(name = Constants.DEVICE)
public class DeviceWithExtra extends BaseDevice {
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "deviceRealization_id")
	public DeviceRealization realization;
	public Double latitude;
	public Double longitude;
	@Column(scale = 2, precision = 16)
	public BigDecimal price;
	
	public DeviceWithExtra() {
	}

	public DeviceWithExtra(NetWithLicense net, DeviceType type, String number,
			int nChannels, int watts, DeviceState state, String city,
			String address, String telegraphCallsign,
			String telegraphCallsignNumber, String telephoneCallsign,
			String telephoneCallsignNumber, DeviceRealization realization,
			Double latitude, Double longitude, BigDecimal price) {
		super(net, type, number, nChannels, watts, state, city, address,
				telegraphCallsign, telegraphCallsignNumber, telephoneCallsign,
				telephoneCallsignNumber);
		this.realization = realization;
		this.latitude = latitude;
		this.longitude = longitude;
		this.price = price;
	}

	public DeviceWithExtra(NetWithLicense net) {
		super(net);
	}

}
